const store = require("./store/优化/index-优化")

console.log(store.getState());

//修改store中的数据: 必须通过action
const nameAction = { type: "change_name", name: "李四" }

//调用dispatch，reducer函数会重新执行, 把原state和action传入, 然后我们就可以根据原state和action，对返回的state进行修改
store.dispatch(nameAction);

console.log(store.getState());

//派发action
const counterAction = { type: 'add_number', counter: 10}
store.dispatch(counterAction)
console.log(store.getState());